#pragma once
//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
//#include <IRcEngine/IRcDefs.h>
#include <RcSysPktLib/RcSysPktTypes.h>
#include <VxUtilLib/VxCommon.h>

enum EScanType
{
	eScanTypeInvalid,
	eScanTypePeopleSearch,
	eScanTypeMoodMsgSearch,
	eScanTypeProfilePic,
	eScanTypeCamServer,
	eScanTypeFileSearch,
	eScanTypeStoryBoard,

	eMaxScanType
};

#define RC_SYS_PKT_MAX_SEARCH_STR_LEN (255 + 16)
#define RC_SYS_PKT_MAX_IDENT_MATCH (20)

#pragma pack(push) 
#pragma pack(1)
class RcSysPktSearchReq : public RcSysPktHdr
{
public:
	//=== vars ===//
	U8				m_u8SearchType;
	U8				m_u8Res1;
	U16				m_u16SearchFlags;
	U32				m_u32Res3;
	char			m_as8SearchExpression[ RC_SYS_PKT_MAX_SEARCH_STR_LEN ];

	//=== constructor ===//
    RcSysPktSearchReq();

    void calcPktLen( void );

    void			setSearchType( EScanType eScanType );
    EScanType		getSearchType( void );
    void			setSearchFlags( U16 u16SeachFlags );
    U16				getSearchFlags( void );
    bool			setSearchExpression( const char * pExp );
    const char *	getSearchExpression( void );
};

class RcSysPktSearchReply : public RcSysPktHdr
{
public:
	//=== vars ===//
	U8				m_u8SearchType;
	U8				m_u8SizeOfIdent;
	U16				m_u16SearchFlags;
	U16				m_u16IdentMatchCount;
	U16				m_u16TotalIdentCount;
	U32				m_u32Res3;
	U8				m_aoSearchMatch[ RC_SYS_PKT_MAX_IDENT_MATCH * sizeof(VxNetIdent) + 64 ];

	//=== constructor ===//
    RcSysPktSearchReply();

    void calcPktLen( void );

    void			setSearchType( EScanType eScanType );
    EScanType		getSearchType( void );
    void			setSearchFlags( U16 u16SeachFlags );
    U16				getSearchFlags( void );
};

#pragma pack(pop)





